package com.lxh.visitor;

/**
 * 访问者模式
 * Create by lxh on 2020/2/16
 */
public class Main {
    public static void main(String[] args) {
        ObjectStricture stricture = new ObjectStricture();
        stricture.attach(new Man());
        stricture.attach(new Woman());

        // 成功时候的反应
        Success success = new Success();
        stricture.show(success);

        // 高兴时的反应
        Happy happy = new Happy();
        stricture.show(happy);
    }
}
